package org.gesplan.entity.sig;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author David
 */
@Entity
@Table(name = "camins")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Camins.findAll", query = "SELECT e FROM Camins e ORDER BY e.codiCami"),
    @NamedQuery(name = "Camins.findByCodiCami", query = "SELECT e FROM Camins e WHERE e.codiCami = :codiCami")
})
public class Camins implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codi_cami")
    private String codiCami;
    @Column(name = "nom")
    private String nom;


    public Camins() {
    }


    public Camins(String codiCami) {
        this.codiCami = codiCami;
    }


    public String getCodiCami() {
        return codiCami;
    }


    public void setCodiCami(String codiCami) {
        this.codiCami = codiCami;
    }

    
    public String getNom() {
        return nom;
    }


    public void setNom(String nom) {
        this.nom = nom;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codiCami != null ? codiCami.hashCode() : 0);
        return hash;
    }


    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Camins)) {
            return false;
        }
        Camins other = (Camins) object;
        return (this.codiCami != null || other.codiCami == null) && (this.codiCami == null || this.codiCami.equals(other.codiCami));
    }


    @Override
    public String toString() {
        return codiCami + " - " + nom;
    }
    
    
}